package com.edt.ichannel.api.service;

import com.edt.ichannel.api.entiy.local.CommissionMonthRule;
import com.edt.ichannel.api.entiy.local.CommissionMonthRuleLink;
import com.edt.ichannel.api.entiy.local.CommissionRuleRoot;
import com.edt.ichannel.api.entiy.local.OrderCreditKd;

import java.util.Date;

public interface CommissionRootRuleService {

    /**
     * 获得首充该订单的佣金
     * @author 孙梁
     * 2018/7/17 9:29
     */

    CommissionRuleRoot getCommissionRuleCK(String cityCode, String productCode, int firstMoney, int type, Date firstDate);

    /**
     *  判断补发规则
     * @param cityCode 地市
     * @param productCode 产品
     * @param firstMoney 首充
     * @param expansionType 渠道类型
     * @return 规则
     */
    CommissionRuleRoot getCommissionRuleKD(String cityCode, String productCode, int firstMoney, int expansionType, Date firstDate);

    /**
     * 验证宽带号是否有规则
     * @param orderCreditKd 号码信息
     * @return
     */
    boolean matchCommisionRule(OrderCreditKd orderCreditKd);

    boolean matchCommisionRuleC(OrderCreditKd orderCreditKd);

    CommissionRuleRoot getCommissionRuleCKC(String cityCode, String productCode, Integer firstMoney, Date firstDate);

    CommissionRuleRoot getCommissionRuleKDC(String cityCode, String productCode, Integer firstMoney, Date firstDate);

    boolean matchCommisionRuleKd(OrderCreditKd orderCreditKd);

    boolean matchCommisionRuleKdC(OrderCreditKd orderCreditKd);

    /**
     * 根据地市 产品编码 首充金额 合伙人类别，首充时间查询按月发放规则
     * @param cityCode 地市编码
     * @param productCode 产品编码
     * @param firstMoney 首充金额
     * @param channelType 合伙人类别
     * @param firstDate 首充时间
     * @return
     */
    CommissionMonthRule getCommissionMonthRule(String cityCode, String productCode, Integer firstMoney, Integer channelType, Date firstDate);

    CommissionMonthRuleLink getNextCommissionRuleMonthLink(String id, int nextCount);

    /**
     * 根据id查询 月发规则
     * @param ruleId 规则id
     * @return 查询到的规则
     */
    CommissionMonthRule getCommissionMonthRuleById(String ruleId);
}
